<!DOCTYPE html>
<html>

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>Lowin</title>
	<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
	<link rel="stylesheet" href="assets/css/auth.css">
	<script>
        var layer;
        $(function () {
            layui.use('layer',function () {
                layer=layui.layer;
            });
        });
		function sub() {

			// alert($("#form1").serialize());
			//用js脚本去提交表单
			// $("form:first").submit();
			// 发送异步请求
			$.ajax({
				type: "POST", //请求的方式：post
				url: "alogin.action",//请求的路径
				// data: "name=John&location=Boston",
				// data:{userName:$("#userName").val(),pwd:$("#pwd").val()}, //要提交的参数
				data:$("#form1").serialize(),//表单序列化
				// 成功后要执行的回调函数
				success: function(msg){
					if(msg=="ok"){

					}else{
                        layer.msg("用户名或者密码错误");
					}
				},
				error:function (xhr,info,e) {
					alert("错误："+info+e);
				}
			});
		}
	</script>
</head>

<body>
	<div class="lowin lowin-blue">
		<div class="lowin-brand">
			<img src="assets/images/kodinger.jpg" alt="logo">
		</div>
		<div class="lowin-wrapper">
			<div class="lowin-box lowin-login">
				<div class="lowin-box-inner">
					<form id="form1">
						<p style="font-size: 20px">培训班管理系统</p>
						<div class="lowin-group">
							<label >用户名 <a href="#" class="login-back-link">登录?</a></label>
							<input  type="text"  name="username" class="lowin-input">
						</div>
						<div class="lowin-group password-group">
							<label > 密码 <a href="#" class="forgot-link">忘记密码?</a></label>
							<input  type="password" name="pwd" autocomplete="current-password" class="lowin-input">
						</div>
						<button class="lowin-btn login-btn"  >
							登录
						</button>

						<div class="text-foot">
							没有账户? <a href="" class="register-link">注册</a>
						</div>
					</form>
				</div>
			</div>

			<div class="lowin-box lowin-register">
				<div class="lowin-box-inner">
					<form>
						<p>注册</p>
						<div class="lowin-group">
							<label>用户名</label>
							<input type="text" name="name"  class="lowin-input">
						</div>
						<div class="lowin-group">
							<label>邮箱</label>
							<input type="email" autocomplete="email" name="email" class="lowin-input">
						</div>
						<div class="lowin-group">
							<label>密码</label>
							<input type="password" name="password" autocomplete="current-password" class="lowin-input">
						</div>
						<button class="lowin-btn">
							注册
						</button>

						<div class="text-foot">
							已经拥有账户? <a href="" class="login-link" >登录</a>
						</div>
					</form>
				</div>
			</div>
		</div>
	
		<footer class="lowin-footer">
			<!--<a href="index.jsp">测试页面</a>-->
		</footer>
	</div>

	<script src="assets/js/auth.js"></script>
	<script>
		Auth.init({
			login_url: 'alogin.action',
			forgot_url: '#forgot'
		});
	</script>
</body>
</html>